﻿@model S4Store.Models.AfterSaleReport.SparePartModel

@{
    ViewBag.Title = "RemainingInventory";
    Layout = null;

    var standardConfig = Model.MonthConfigs.FirstOrDefault();
    if(standardConfig==null)
    {
        standardConfig = new S4Store.Domain.AfterSaleKpi.SparePartsMonthInput();
    }
}
 <div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
@{
    S4Store.Models.Chart.Column ChartModel = new S4Store.Models.Chart.Column();
    ChartModel.Colors = new List<string> { S4Store.Models.Chart.Color.Green, S4Store.Models.Chart.Color.Blue };
    //ChartModel.Name = "登记客户";
    ChartModel.YAxis = "比例(%)";
    ChartModel.IsNegative = true;
    //ChartModel.Width = 500;
    //ChartModel.Height = 300;
    //foreach (var item in list)
    //{
    //    ChartModel.XAxis.Add(item.车型);
    //}
    ChartModel.XAxis.Add("呆库存变化率");
    ChartModel.XAxis.Add("死库存变化率");

    S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标";
    series1.Data.Add(standardConfig.DZKCBHLMB);
    series1.Data.Add(standardConfig.SKCBHLMB);
    ChartModel.Serieses.Add(series1);


    S4Store.Models.Chart.ChartSeries series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际";
    series2.Data.Add(Model.DZKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month));
    series2.Data.Add(Model.SKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month));
    ChartModel.Serieses.Add(series2);
}
<div class="pagetitle">备件库存管理关键KPI</div>
@Html.Partial("../Chart/Column", ChartModel)
<table style="width:100%">
            <tr>
                <td align="center" width="30">
                    @if (Model.DZKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month) > standardConfig.DZKCBHLMB)
                {
                    <a class="middlered" href="@Url.Action("DZKBHL", new { month = Model.BarModel.Month })" target="navtab" title="呆滞库变化率">
                        @(Model.DZKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month) - standardConfig.DZKCBHLMB)%
                    </a>
                }
                else
                {
                    <a class="middlegreen" href="@Url.Action("DZKBHL", new { month = Model.BarModel.Month })" target="navtab" title="呆滞库变化率">
                        @(Model.DZKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month) - standardConfig.DZKCBHLMB)%
                    </a>
                }
                    
                </td>

                <td align="center" width="30">

                @if (Model.DZKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month) > standardConfig.SKCBHLMB)
                {
                    <a class="middlered" href="@Url.Action("SKCBHL", new { month=Model.BarModel.Month})" target="navtab" title="死库存变化率">
                        @(Model.SKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month) - standardConfig.SKCBHLMB)%
                    </a>
                }
                else
                {
                    <a class="middlegreen" href="@Url.Action("SKCBHL", new { month = Model.BarModel.Month })" target="navtab" title="死库存变化率">
                        @(Model.SKBHL(Model.BarModel.Month.Year, Model.BarModel.Month.Month) - standardConfig.SKCBHLMB)%
                    </a>
                }

                    
                </td>

            </tr>
</table>
</div>